﻿using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using DevExpress.XtraReports.UI;
using System.Collections.Generic;
namespace Exact_VAS
{
    public partial class PaymentOrderCBARpt : DevExpress.XtraReports.UI.XtraReport
    {
        Common common;
        public PaymentOrderCBARpt()
        {
            InitializeComponent();
            common = new Common();
        }
        public void LoadDataSource(ISHCMC_V_BankPaymentVoucher itemVoucher)
        {
            List<PaymentOrderBank> ListPaymentOrderBank = new List<PaymentOrderBank>();
            PaymentOrderBank item = new PaymentOrderBank();
            item.Amount = Math.Abs(itemVoucher.Amount);
            item.BankAccountNumber = itemVoucher.BenefiaciaryAccount;
            item.BankBranchName1 = itemVoucher.BenefiaciaryBankBranch;
            item.BenneficiaryName1 = itemVoucher.BenefiaciaryName;
            item.Currency = itemVoucher.Currency;
            item.AmountInWord = common.So_chu(item.Amount,item.Currency.ToString());
            item.Comment = "Voucher No:" + itemVoucher.JournalNumber.Trim() + "." + itemVoucher.EntryNumber + ";" + itemVoucher.Description;
            
            item.TransDate = DateTime.Now.Date;
            item.VoucherNo = itemVoucher.JournalNumber.Trim() + "." + itemVoucher.EntryNumber;
            ListPaymentOrderBank.Add(item);
            this.bindingSource1.DataSource = ListPaymentOrderBank;
        }
    }
}
